﻿@model WaiGaoQiaoWeb.Models.GasVM
@{
    ViewBag.Title = "Add";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@section Head
{
    @Html.Css("dp")
    @Html.Js("datepicker")
   @* <script type="text/javascript" src="../../Scripts/datepicker-zh.js"></script>*@
    <script type="text/javascript">
        $(document).ready(function () {
            $("#CBDT").datepicker({ dateFormat: 'yy-mm-dd' });
            $("#OpenMachDt").datepicker({ dateFormat: 'yy-mm-dd' });
            $("#StopMachDt").datepicker({ dateFormat: 'yy-mm-dd' });
            $("form").makeValidationInline();
            //保存
            $("#btnSave").click(function (event) {
                if (!$("#fmEdit").valid()) {
                    return false;
                }
                $('#fmEdit').ajaxSubmit(function (callback) {
                    if (callback) {
                        refresh();
                    }
                });
            }); // end of btnSave

            //关闭
            $("#btnCancel").click(function (e) {
                CloseModelWindow(null, true);
                return false;
            });
            var option = {
                height: 220,
                width: 740,
                url: '@Url.Action("GetGasData")',
                colModel: [
                    { display: 'ID', name: 'ID', width: 60, sortable: false, align: 'left', hide: true, iskey: true },
                    { display: '抄表日期', name: 'CBDT', width: 80, sortable: false, hide: false, align: 'left' },
			        { display: '班组编号', name: 'GroupNo', width: 80, sortable: false, hide: false, align: 'left' },
                    { display: '当班人员', name: 'GroupMan', width: 80, sortable: false, hide: false, align: 'left' },
                    { display: '机器编号', name: 'MachNo', width: 120, sortable: false, hide: false, align: 'left' },
                    { display: '开机时间', name: 'OpenMachDt', width: 50, sortable: false, hide: false, align: 'left' },
                    { display: '停机时间', name: 'StopMachDt', width: 50, sortable: false, hide: false, align: 'left' },
                    { display: '燃气类型', name: 'RanqiType', width: 70, sortable: false, hide: false, align: 'left' },
                    { display: '项目', name: 'TeamNo', width: 120, sortable: false, hide: true, align: 'left' },
                    { display: '7:00(19:00)', name: 'StartTime', width: 120, sortable: false, hide: true, align: 'left' },
                    { display: '8:00(20:00)', name: 'OneTime', width: 120, sortable: false, hide: true, align: 'left' },
                    { display: '9:00(21:00)', name: 'TwoTime', width: 120, sortable: false, hide: true, align: 'left' },
                    { display: '10:00(22:00)', name: 'ThreeTime', width: 120, sortable: false, hide: true, align: 'left' },
                    { display: '11:00(23:00)', name: 'FourTime', width: 120, sortable: false, hide: true, align: 'left' },
                    { display: '12:00(00:00)', name: 'FiveTime', width: 120, sortable: false, hide: true, align: 'left' },
                    { display: '13:00(1:00)', name: 'SixTime', width: 120, sortable: false, hide: true, align: 'left' },
                    { display: '14:00(2:00)', name: 'SevenTime', width: 120, sortable: false, hide: true, align: 'left' },
                    { display: '15:00(3:00)', name: 'EightTime', width: 120, sortable: false, hide: true, align: 'left' },
                    { display: '16:00(4:00)', name: 'NineTime', width: 120, sortable: false, hide: true, align: 'left' },
                    { display: '17:00(5:00)', name: 'TenTime', width: 120, sortable: false, hide: true, align: 'left' },
                    { display: '18:00(6:00)', name: 'ElevenTime', width: 120, sortable: false, hide: true, align: 'left' },
                    { display: '记录日期', name: 'CreateDt', width: 120, sortable: false, hide: true, align: 'left' }

				],
                singleselected: true,
                sortname: "Sequence",
                sortorder: "asc",
                title: false,
                usepager: true,
                page: 1,
                rp: 15,
                rpOptions: [10, 15],
                showcheckbox: true,
                rowbinddata: true

            };
            var grid = $("#GasList").flexigrid(option);

            function refresh() {
                showLoadingMsg("保存成功", { left: 400, top: 6 }, true, 3000);
                $("#GasList").flexOptions(option).flexReload();
            }
        });
    </script>
}
@using (Html.BeginForm("SaveGas", "Gas", FormMethod.Post, new { id = "fmEdit" }))
{
    @Html.ValidationSummary(true)
    <div class="mainpanel">
        @Html.HiddenFor(model => model.ID)
        @Html.HiddenFor(model => model.CreateDt)
        <table style="width: 100%; width: 740px;">
            <tr>
                <td style="text-align: right;">@Html.LabelFor(model => model.CBDT)
                </td>
                <td>@Html.TextBoxFor(model => model.CBDT, new { @style = "width:145px;", @ReadOnly = true })
                </td>
                <td style="text-align: right;">@Html.LabelFor(model => model.GroupNo)
                </td>
                <td>
                    @Html.TextBoxFor(model => model.GroupNo)
                </td>
            </tr>
            <tr>
                <td style="text-align: right;">@Html.LabelFor(model => model.GroupMan)
                </td>
                <td>
                    @Html.TextBoxFor(model => model.GroupMan)
                </td>
                <td style="text-align: right;">@Html.LabelFor(model => model.MachNo)
                </td>
                <td>
                    @Html.TextBoxFor(model => model.MachNo)
                </td>
            </tr>
            <tr>
                <td style="text-align: right;">@Html.LabelFor(model => model.OpenMachDt)
                </td>
                <td>
                    @Html.TextBoxFor(model => model.OpenMachDt)
                </td>
                <td style="text-align: right;">@Html.LabelFor(model => model.StopMachDt)
                </td>
                <td>@Html.TextBoxFor(model => model.StopMachDt)
                </td>
            </tr>
            <tr>
                <td style="text-align: right;">@Html.LabelFor(model => model.RanqiType)
                </td>
                <td>
                    @Html.DropDownListFor(model => model.RanqiType,
      ViewData["ItemType"] as IEnumerable<SelectListItem>,
                            new { @style = "width:152px; height:22px; font-size:13px;" })
                </td>
                <td style="text-align: right;">@Html.LabelFor(model => model.TeamNo)
                </td>
                <td>
                  @*  @Html.DropDownListFor(model => model.TeamNo,
                  ViewData["TeamNo"] as IEnumerable<SelectListItem>,
                            new { @style = "width:152px; height:22px; font-size:13px;" })*@
                </td>
            </tr>
            <tr>
                <td style="text-align: right;">@Html.LabelFor(model => model.StartTime)
                </td>
                <td>
                    @Html.TextBoxFor(model => model.StartTime)
                </td>
                <td style="text-align: right;">@Html.LabelFor(model => model.OneTime)
                </td>
                <td>@Html.TextBoxFor(model => model.OneTime)
                </td>
            </tr>
            <tr>
                <td style="text-align: right;">@Html.LabelFor(model => model.TwoTime)
                </td>
                <td>
                    @Html.TextBoxFor(model => model.TwoTime)
                </td>
                <td style="text-align: right;">@Html.LabelFor(model => model.ThreeTime)
                </td>
                <td>@Html.TextBoxFor(model => model.ThreeTime)
                </td>
            </tr>
            <tr>
                <td style="text-align: right;">@Html.LabelFor(model => model.FourTime)
                </td>
                <td>
                    @Html.TextBoxFor(model => model.FourTime)
                </td>
                <td style="text-align: right;">@Html.LabelFor(model => model.FiveTime)
                </td>
                <td>@Html.TextBoxFor(model => model.FiveTime)
                </td>
            </tr>
            <tr>
                <td style="text-align: right;">@Html.LabelFor(model => model.SixTime)
                </td>
                <td>
                    @Html.TextBoxFor(model => model.SixTime)
                </td>
                <td style="text-align: right;">@Html.LabelFor(model => model.SevenTime)
                </td>
                <td>@Html.TextBoxFor(model => model.SevenTime)
                </td>
            </tr>
            <tr>
                <td style="text-align: right;">@Html.LabelFor(model => model.EightTime)
                </td>
                <td>
                    @Html.TextBoxFor(model => model.EightTime)
                </td>
                <td style="text-align: right;">@Html.LabelFor(model => model.NineTime)
                </td>
                <td>@Html.TextBoxFor(model => model.NineTime)
                </td>
            </tr>
            <tr>
                <td style="text-align: right;">@Html.LabelFor(model => model.TenTime)
                </td>
                <td>
                    @Html.TextBoxFor(model => model.TenTime)
                </td>
                <td style="text-align: right;">@Html.LabelFor(model => model.ElevenTime)
                </td>
                <td>@Html.TextBoxFor(model => model.ElevenTime)
                </td>
            </tr>
            <tr>
                <td>
                </td>
                <td>
                </td>
                <td colspan="2" style="text-align: right;">
                    <a id="btnSave" class="button" href="javascript:void(0);"><span>保 存</span></a>
                     <a id="btnCancel" class="button" href="javascript:void(0);"><span>关 闭</span></a>
                </td>
            </tr>
        </table>
        <div style="width: 740px; overflow-x: scroll;">
            <table id="GasList" style="display: none;">
            </table>
        </div>
    </div>
}
